package com.prize.controller.v1;

import com.prize.dtos.ResponseResult;
import com.prize.login.apis.LoginControllerApi;
import com.prize.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @descriptions: 后台登录接口
 * @author: yunqiang
 * @date: 2022/5/28 11:04
 */
@Api(tags = {"后台登录：后台用户登录"})
@RestController
@RequestMapping("/api/v1/login")
public class LoginController implements LoginControllerApi {


    @Autowired
    private LoginService loginService;



    @Override
    @ApiOperation(value = "根据用户名、密码以及验证码登录")
    @PostMapping("/login_auth")
    public ResponseResult login(@RequestParam(name = "username",required = true) String username,
                                @RequestParam(name = "password",required = true)String password,
                                @RequestParam(name = "uuid",required = true)String uuid,
                                @RequestParam(name = "captcha",required = true)String captcha) {
        return loginService.login(username,password,uuid,captcha);
    }
}
